Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

quick-temp

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quick-temp

Create and remove temporary directories with minimal effort

  • 0.1.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
349K
decreased by-1.89%
Maintainers
1
Weekly downloads
 
Created
Source

node-quick-temp

Create and remove temporary directories. Useful for build tools, like Broccoli plugins. Smart about naming, and placing them in ./tmp if possible, so you don't have to worry about this.

Installation

npm install --save quick-temp

Usage

var quickTemp = require('quick-temp');

Creating a temporary directory

To make a temporary and assign its path to this.tmpDestDir, call either one of these:

quickTemp.makeOrRemake(this, 'tmpDestDir');
// or
quickTemp.makeOrReuse(this, 'tmpDestDir');

If this.tmpDestDir already contains a path, makeOrRemake will remove it first and then create a new directory, whereas makeOrReuse will be a no-op.

Both functions also return the path of the temporary directory.

An optional third argument lets you override the class-name component of the temporary directory name:

quickTemp.makeOrRemake(this, 'tmpDestDir', 'TreeMerger');
quickTemp.makeOrRemake(this, 'tmpDestDir', this.constructor.name); // default

Removing a temporary directory

To remove a previously-created temporary directory and all its contents, call

quickTemp.remove(this, 'tmpDestDir');

This will also assign this.tmpDestDir = null. If this.tmpDestDir is already null or undefined, it will be a no-op.

FAQs

Package last updated on 14 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc